{template 'public/header'}
{template 'public/comhead'}
<link rel="stylesheet" type="text/css" href="../addons/zh_tcwq/template/public/ygcsslist.css">
<style type="text/css">
     .accout_inp{width: 100%;height: 35px;border: 1px solid #cccccc;font-size: 14px;color: #333;}
</style>
<ul class="nav nav-tabs">
  <span class="ygxian"></span>
  <div class="ygdangq">当前位置:</div>
 <li  {if $type=='wait'} class="active" {/if}><a href="{php echo $this->createWebUrl('inzxpinglun',array('type'=>wait,'status'=>1));}">未回复</a></li>
 <li   {if $type=='ok'} class="active" {/if}><a href="{php echo $this->createWebUrl('inzxpinglun',array('type'=>ok,'status'=>2));}">已回复</a></li>
 <li   {if $type=='all'} class="active" {/if}><a href="{php echo $this->createWebUrl('inzxpinglun',array('type'=>all));}">全部</a></li>
</ul>
 <div class="row ygrow">
      <div class="col-md-3">
          <form action="" method="get">
                <input type="hidden" name="c" value="site" />
                <input type="hidden" name="a" value="entry" />
                <input type="hidden" name="m" value="zh_tcwq" />
                <input type="hidden" name="do" value="inzxpinglun" />
                <div class="input-group" style="width: 300px">
                    <input type="text" name="keywords" class="form-control" placeholder="请输入评论内容">
                    <span class="input-group-btn">
                        <input type="submit" class="btn btn-default" name="submit" value="查找"/>
                    </span>
                </div>
                <input type="hidden" name="token" value="{$_W['token']}"/>
          </form>
      </div>
      <div class="col-md-3">
        <div class="btn btnblue" id="allselect">批量删除</div>
      </div>
</div>
<div class="main">
    <!-- 门店列表部分开始 -->
        <div class="panel panel-default">
            <div class="panel-heading">
                评论列表
            </div>
            <div class="panel-body" style="padding: 0px 15px;">
                <div class="row">
                    <table class="col-md-12" >
              	<tr class="yg5_tr1">
                  <td class="store_td1 col-md-1" style="text-align: center;">
                    <input type="checkbox" class="allcheck" />
                    <span class="store_inp">全选</span>                      
                  </td>
                	<th class="col-md-2 store_td1">资讯标题</th>
	                <th class="col-md-2">评论内容</th>
	               <!--  <th class="col-md-1">评价分数</th> -->
	                <th class="col-md-2">评论时间</th>
	                <th class="col-md-1">回复内容</th>
	                <th class="col-md-2">回复</th>
	                <th class="col-md-2">操作</th>
              </tr>
              {loop $list $key $item}
              <tr class="yg5_tr2">
                <td>
                  <input type="checkbox" name="test" value="{$item['id']}">
                </td>
                <td>
                {$item['title']}
                </td>
               
                 <td>
                {$item['content']}
                </td>
              <!--   <td>
                {$item['score']}
              </td> -->
                <td>
                  {$item['cerated_time']}
                </td>
               <td>
                  {$item['reply']}
                </td>
                <td>
                  {if $item['status']==1}
                  <a href="javascript:void(0);" data-toggle="modal" data-target="#myModal{$item['id']}"><span class="label storeblue" style="padding: 7px;margin-top: 3px;">回复</span> </a>
                  {else}
                <span class="label storegrey" style="padding: 6px;margin-top: 3px;">已回复</span>
                  {/if}
                  
                </td>
                  <td>
                  <a href="{php echo $this->createWebUrl('inpingluninfo', array('id'=>$item['id'],'op'=>'info'));}" class="storespan btn btn-xs">
                      <span class="fa fa-pencil"></span>
                      <span class="bianji">编辑
                          <span class="arrowdown"></span>
                      </span>                            
                  </a>
                  <a href="{php echo $this->createWebUrl('inzxpinglun', array('id'=>$item['id'],'op'=>'delete'));}" class="storespan btn btn-xs" onclick="if(!confirm('删除后将不可恢复,确定删除吗?')) return false;">
                      <span class="fa fa-trash-o"></span>
                      <span class="bianji">删除
                          <span class="arrowdown"></span>
                      </span>
                  </a>
                    <!-- <a href="{php echo $this->createWebUrl('inpingluninfo', array('id'=>$item['id'],'op'=>'info'));}" ><span class="label label-info">查看</span> </a> -->
                  <!-- <a onclick="if(!confirm('删除后将不可恢复,确定删除吗?')) return false;" href="{php echo $this->createWebUrl('inzxpinglun', array('id'=>$item['id'],'op'=>'delete'));}" class="btn btn-default btn-danger" data-toggle="tooltip" data-placement="top" title="" data-original-title="删除"><i class="fa fa-times"></i> </a> -->   
                </td>
              </tr>
                <div class="modal fade" id="myModal{$item['id']}" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
                      <div class="modal-dialog" role="document">
                          <form action="" method="post" enctype="multipart/form-data">
                              <div class="modal-content">
                                  <div class="modal-header">
                                      <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                                      <h4 class="modal-title" id="myModalLabel" style="font-size: 20px;">编辑回复内容</h4>
                                  </div>
                                  <div class="modal-body" style="font-size:20px">
                                      <input type="text" name="reply" class="accout_inp" placeholder="请输入回复内容">
                                  </div>
                                  <div class="modal-footer">
                                      <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                                      <input type="submit" name="submit2" class="btn btn-info" value="确定">
                                      <input type="hidden" name="token" value="{$_W['token']}"/>
                                      <input type="hidden" name="id" value="{$item['id']}"/>
                                         
                                  </div>
                              </div>
                          </form>
                      </div>
                  </div>
              {/loop}
              {if empty($list)}
             <tr class="yg5_tr2">
                <td colspan="12">
                  暂无评论信息
                </td>
              </tr>
             
              {/if}
          </table>
                </div>
            </div>
        </div>
    
</div>
<div class="text-right we7-margin-top">{$pager}</div>
<script type="text/javascript">
    $(function(){
        $("#frame-3").show();
        $("#yframe-3").addClass("wyactive");
        // ———————————————批量删除———————————————
        $("#allselect").on('click',function(){
            var check = $("input[type=checkbox][class!=allcheck]:checked");
            if(check.length < 1){
                alert('请选择要删除的资讯!');
                return false;
            }else if(confirm("确认要删除此资讯?")){
                var id = new Array();
                check.each(function(i){
                    id[i] = $(this).val();
                });
                console.log(id)
                $.ajax({
                    type:"post",
                    url:"{$_W['siteroot']}/app/index.php?i={$_W['uniacid']}&c=entry&do=&m=zh_tcwq",
                    dataType:"text",
                    data:{id:id},
                    success:function(data){
                        console.log(data);      
                       // location.reload();
                    }
                })
               
            }
        });
        $(".allcheck").on('click',function(){
            var checked = $(this).get(0).checked;
            $("input[type=checkbox]").prop("checked",checked);
        });
    })
</script>{template 'common/footer'}